#ifndef GSPLUGIN_H
#define GSPLUGIN_H

#include "data/gsdata.h"
#include "gsplot.h"

#include <QObject>
#include <QtPlugin>
#include <QString>
#include <QList>

class GSPlugIn : public QObject
{
    Q_OBJECT
    Q_ENUMS(PlugInType)
public:
    enum PlugInType { ANALYSIS_COMPONENT, ANALYSIS_CORRELATION, //Analysis
                      ANALYSIS_CLUSTER, ANALYSIS_EXT,
                      PROCESSING_TRANSFORM, PROCESSING_FILTER,    //Processing
                      PROCESSING_RECONSTRUCTION, PROCESSING_EXT };

    GSPlugIn(void) {}
    virtual ~GSPlugIn(void) = 0;

    void setData(QList<GSData*>* dataSet) {this->dataSet = dataSet;}

    QString getMenuName(){ return menuName; }
    QString getComments(){ return comments; }
    QString getDllName(){ return dllName; }
    PlugInType getPlugInType(){ return type; }

signals:
    void getData(GSData data);

public slots:
    virtual bool create(void) = 0;
    virtual void close(void) = 0;
    //re-map signal
    void exportData(GSData data){emit getData(data);}

public:
    QList<GSData*>* dataSet = NULL;
protected:
    PlugInType type;
    QString menuName;
    QString comments;
    QString dllName; //dynamic library name
};

Q_DECLARE_INTERFACE(GSPlugIn, "gspp.plugin")

#endif // GSPLUGIN_H
